﻿using System.Collections;
using System.Collections.Generic;

public abstract class FSMTransition 
{

    protected FSMState m_FromState;
    public FSMState fromState
    {
        get { return m_FromState; }
        set { m_FromState = value; }
    }

    protected FSMState m_ToState;
    public virtual FSMState toState { get { return m_ToState; } }

    protected FSMController m_Controller;

    public FSMTransition()
    {

    }
    public FSMTransition(FSMState toState)
    {
        Init(null, toState);
    }
    public FSMTransition(FSMState fromState, FSMState toState)
    {
        Init(fromState, toState);
    }

    void Init(FSMState fromState, FSMState toState)
    {
        m_FromState = fromState;
        m_ToState = toState;

        if (fromState != null)
            m_Controller = fromState.controller;
        else if (toState != null)
            m_Controller = toState.controller;
        else
            GameDebug.LogError("fromState == null && toState == null");
    }

    public virtual bool Meet() { return false; }
    public virtual bool MeetSign(int sign) { return false; }

  


}
